<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>flex demo</title>
    <style>
        [class*='box'] {
            width: 50px;
            height: 50px;
            box-shadow: gray 0 0 5px 2px;
            margin: 15px;
            border-radius: 15%;
            padding: 8px;
        }
        
        .item {
            width: 14px;
            height: 14px;
            flex-basis: 14px;
            border-radius: 50%;
            background-color: black;
        }
        
        .box1 {
            display: flex;
            justify-content: center;
            align-items: center;
        }
        
        .box2 {
            display: flex;
            flex-flow: column nowrap;
            justify-content: space-between;
            align-items: center;
        }
        
        .box3 {
            display: flex;
            justify-content: space-between;
        }
        
        .box3>.item:nth-child(2) {
            align-self: center;
        }
        
        .box3>.item:nth-child(3) {
            align-self: flex-end;
        }
        
        .box4 {
            display: flex;
            flex-flow: row wrap;
            align-items: space-between;
            /* 辅轴居中 */
        }
        
        .box4 .column {
            flex-basis: 100%;
            /* 这一条很关键 */
            display: flex;
            justify-content: space-between;
        }
        
        .box4 .column:nth-child(2) {
            align-items: flex-end;
        }
        
        .box5 {
            display: flex;
            flex-flow: row wrap;
            justify-content: center;
            align-items: center;
            /* 同时居中 */
        }
        
        .box5 .column {
            flex-basis: 100%;
            display: flex;
            justify-content: space-between;
        }
        
        .box5 .column:nth-child(2) {
            justify-content: center;
        }
        
        .box6 {
            display: flex;
            justify-content: space-between;
        }
        
        .box6 .column {
            flex-basis: 100%;
            display: flex;
            flex-flow: column nowrap;
            justify-content: space-between;
        }
        
        .box6 .column:nth-child(2) {
            align-items: flex-end;
        }
    </style>
</head>

<body>
    <div class="box1">
        <span class="item"></span>
    </div>
    <div class="box2">
        <span class="item"></span>
        <span class="item"></span>
    </div>
    <div class="box3">
        <span class="item"></span>
        <span class="item"></span>
        <span class="item"></span>
    </div>
    <div class="box4">
        <div class="column">
            <span class="item"></span>
            <span class="item"></span>
        </div>
        <div class="column">
            <span class="item"></span>
            <span class="item"></span>
        </div>
    </div>
    <div class="box5">
        <div class="column">
            <span class="item"></span>
            <span class="item"></span>
        </div>
        <div class="column">
            <span class="item"></span>
        </div>
        <div class="column">
            <span class="item"></span>
            <span class="item"></span>
        </div>
    </div>
    <div class="box6">
        <div class="column">
            <span class="item"></span>
            <span class="item"></span>
            <span class="item"></span>
        </div>
        <div class="column">
            <span class="item"></span>
            <span class="item"></span>
            <span class="item"></span>
        </div>
    </div>
</body>

</html>